import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import myIndex from '../views/my-index.vue'
import myHome from '@/components/my-index/my-home.vue'

//引入评论区组件
import comment from '../../评论区孔德明/comment1.00.vue'

Vue.use(VueRouter)

const routes = [
  // 添加评论区目录下评论区组件路由到路由列表
  {
    path: '/comment',
    name: 'comment',
    component: comment
  },
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/index',
    name: 'myIndex',
    component: myIndex,
    //测试路由
    children: [
      { path: '', redirect:'home' },
      { path: 'home', component: myHome },
      { path: 'a', },
      { path: 'b',  },
      { path: 'c', },
      { path: 'd',  },
      { path: 'e', },
      { path: 'f',  },
    ]
  },

  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
  ,mode: 'history'
})

export default router
